
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>列表</title>
    {include file="include/top"}
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            {include file="include/selectsearch" ctype='layui-inline' title="服务商" classname='serviceID' optionHtml='<?php echo isset($service)?$service:"";?>' }
            <div class="layui-inline">
                <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                </button>
            </div>
        </div>
        <table class="layui-table" lay-data="{height:0, url:'/service/payMoneyGet', page:true, id:'idTest',toolbar: '#toolbarDemo'}" lay-filter="demo">
            <thead>
            <tr>
                <th lay-data="{field:'id',  sort: true, fixed: true,width:80,checkbox:true}">ID</th>
                <th lay-data="{field:'cids'}">日期</th>
                <th lay-data="{field:'tipsID'}">服务商</th>
                <th lay-data="{field:'title'}">金额</th>
            </tr>
            </thead>
        </table>
        <script type="text/html" id="toolbarDemo">
            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="tipsSave">更新今日数据</button>
            {include file="include/selectsearch" ctype='layui-inline' title="服务商" classname='services' optionHtml='<?php echo isset($service)?$service:"";?>' }
        </script>
        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="more">操作<i
                    class="layui-icon layui-icon-down"></i></a>
        </script>
    </div>
</div>
{include file="include/js"}
<script>
    var pathid=0;
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'contlist', 'table', 'dropdown'], function(){
        var table = layui.table;
        var $ = layui.$;
        var form = layui.form;
        var dropdown = layui.dropdown
        var pathid=0;
        var id=0;
        $("#test-upload-type1").click(function (){
            id=0;
            add();
        })
        $(document).on("click","#tipsSave",function () {
            var $tipsID = $("select[name='services']").val()
            layer.confirm("是否确定获取？", function () {
                $.post("payMoneyGet2", {
                    id: $tipsID
                }, function (res) {
                    if (res.code == 0) {
                        layer.closeAll()
                        layer.msg(res.msg)
                    } else {
                        layer.msg(res.msg)
                    }
                })
            })
        })

        //监听搜索
        form.on('submit(LAY-app-contlist-search)', function(data){
            var field = data.field;
            //执行重载
            table.reload('idTest', {
                where: field
            });
        });
        $('.layui-btn.layuiadmin-btn-tags').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>

</body>
</html>
